<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<script src="scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
	
	<script type="text/javascript">
	var bkP = chrome.extension.getBackgroundPage();
	dislikes = bkP.dislikesBG;
	dislikes.trans = dislikes.transObj;
	</script>
	
	<script src="lang.js" type="text/javascript"></script>
	<style>
body {
min-height: 100px;
font-size: 11px;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
color: 
#333;
line-height: 1.28;
text-align: left;
direction: ltr;
width: 250px;
}
label {
color: #666;
font-weight: bold;
vertical-align: middle;
}
.fbDislikeMargin {
	margin:15px;
}

.fbDislikeMargin.last {
	margin: 0px 10px; text-align: center; 
}

select {
border: 1px solid 
#BDC7D8;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 11px;
padding: 2px;
}


.dislikesOptionsIcon{
position: absolute;
top: 5px;
right: 5px;
}

#loginFirst {
	width: 180px;
}

</style>
</head>
<body>
	<div id="fbDislikesList" style="display: none">
		
	</div>
	
	<div id="loginFirst" style="display: none;">
		
		<label>You must login to Facebook before di.slik.es options appear here.</label>
	</div>
	
	<script>
	var context = document;
	
	dislikes.getURL = function(file)
	{
		return chrome.extension.getURL('skin/'+file);
	};
	
	$(window).unload(function() {
		
		if(dislikes.sessionData == '')
			return;
		
		var el = $('#fbDislikesList');
		
		var newOptions = {};		
		newOptions.language = el.find('#dislikes_options_language').children('option:selected')[0].value;
		newOptions.commentStuff = el.find('input[name="dislikes_options_comment"]:checked').val();
		newOptions.firstTime = 0;
		
		newOptions = $.extend(true, {}, dislikes.options, newOptions);
		
		dislikes.saveOptions(function() {}, dislikes.userID, newOptions);
	});
	
	if(dislikes.sessionData == '') {
		$('#loginFirst').append($('<div>', context).addClass('dislikesOptionsIcon')
							.append($('<img />', context).attr('src', dislikes.getURL("icon48.png")))).show();
	
	} else {
		
		var langSel = $('<select>', context).attr('id', "dislikes_options_language")
							.append($('<option>', context).val(0).attr('selected', 'selected').text(dislikes.getMessage('UseFacebookLanguage')));
		
		for(var loc in dislikes.trans)
		{
			langSel.append($('<option>', context).val(loc).text(dislikes.trans[loc].name));
		}
		
		var elOpt = $('<div>', context)
						.append($('<div>', context).addClass('dislikesOptionsIcon')
							.append($('<img />', context).attr('src', dislikes.getURL("icon48.png"))))
						.append($('<div>', context).addClass("fbDislikeMargin")
							.append($('<label>', context).text(dislikes.getMessage('SelectLanguage')))
							.append($('<br />', context))
							.append(langSel)
							.append($('<br />', context))
							.append($('<br />', context))
							.append($('<span>', context).text(dislikes.getMessage('ReloadAfterChange'))))
						.append($('<div>', context).addClass("fbDislikeMargin")
							.append($('<label>', context).text(dislikes.getMessage('PostRandomComment')))
							.append($('<br />', context))
							.append($('<input />', context).attr({"type": "radio", "value": "1", "name": "dislikes_options_comment"}))
							.append($('<span>', context).text(dislikes.getMessage('Yes')))
							.append($('<input />', context).attr({"type": "radio", "value": "0", "name": "dislikes_options_comment"}))
							.append($('<span>', context).text(dislikes.getMessage('No'))))
						.append($('<div>', context).addClass("fbDislikeMargin last")
							.append($('<table>', context).attr({"align": "center", "width": "90%", "border": 0, "cellspacing": 5, "cellpadding": 0})
								.append($('<tr>', context)
									.append($('<td>', context).attr({"width": "50%", "align": "center"})
										.append($('<form>', context).attr({"action": "https://www.paypal.com/cgi-bin/webscr", "method": "post"}).css('margin-bottom', 0)
											.append($('<input />', context).attr({"type": "hidden", "name": "cmd", "value": "_s-xclick"}))
											.append($('<input />', context).attr({"type": "hidden", "name": "encrypted", "value": "-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAw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WjoVaDVKVaklDwj2kyv/6CmntYl2b8DCoMwazqWnYb+N1blxi9hleWB7oOSjkfSl1+RmMOyDtAkzrLsUPTKhTNJE/w3JU7Vy3w==-----END PKCS7-----"}))
											.append($('<input />', context).attr({"type": "image", "src": "https://www.paypalobjects.com/WEBSCR-640-20110429-1/en_GB/i/btn/btn_donate_SM.gif", "border": 0, "name": "submit", "alt": "PayPal - The safer, easier way to pay online."}))
											.append($('<img />', context).attr({"border": "0", "src": "https://www.paypalobjects.com/WEBSCR-640-20110429-1/pl_PL/i/scr/pixel.gif", "width": "1", "height": 1})))
									)
									.append($('<td>', context).attr({"width": "50%", "align": "center"})
										.append($('<a>', context).attr({"name": "fb_share", "target": "_blank", "type": "button", "share_url": "http://di.slik.es", "href": "http://www.facebook.com/sharer.php?u=http%3A%2F%2Fdi.slik.es&amp;src=sp"})
											.append($("<img />", context).attr("src", dislikes.getURL('share_facebook.png'))))))));
		
		elOpt.find('#dislikes_options_language').children('option[value="'+dislikes.options.language+'"]').attr('selected', true);
		elOpt.find('#dislikes_options_language').children('option[value="'+dislikes.options.language+'"]').siblings().removeAttr('selected');
		
		elOpt.find('input[name="dislikes_options_comment"][value="'+dislikes.options.commentStuff+'"]').attr('checked',  true);
		elOpt.find('input[name="dislikes_options_comment"][value="'+dislikes.options.commentStuff+'"]').siblings().removeAttr('checked');
		
		$('#fbDislikesList').html(elOpt).show();
	
	}
	</script>
</body>
</html>